package com.neugh.controller;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class ShopAlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101300677668";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtmoQxB9LAKBiLnBd8FwB+DHLCO+5D6La3yQX/snBXpHAjz6EFjKVJgNagWS+Sqq0dD153429iD9/Dbu1Z+Lhk1pK8mHBIt23T4P7YR4Bj0mp/PtQTZlM331zRnVZPFccAU12Ai2OnVMFjO9O4EMhJGFaEOB0uKK5SBqkix+01pnzoZln+Y/+8Opb5MwUxyxdU4zUD+J/hiLn85kkjp4Ll4UysqelKX5oxbgD51TcVAeT/R1rposkfUnMZdd/YtwmKX2HgzAEie3cYjgoFhXlVz6uVUI8ZHecl1XUvVHZZBeT3BOsyv7+9swmQc6yTybEL4HR6JCsAigiFv/1jdW1BAgMBAAECggEATW8OZ5BFwNAhoqQNFZxs68xBo8F3lXLHjVJtCpBc67q9CjwiZodFcnO1R/B/97uJW9zvFiqsE+FgvZtM40S9erz61oRoEQdARbGl+nJqIhxIxFkR31VU6ScID7dOOBhOmyaUHjIOUSTM3aZh2UgjDfd9H5yn517d4lh2OL1UYQkUV59OMQQyVjfSYd8O5fCDBe0yuPmkzQA+ODFbdRNH+4JutL8btspdcTRDZ0ZxlCkj3poqGbrqbhpmHodGF/zlj4lfmgsrGoXEfiXIV6EUXNXQXr3dAStA+lLl+JWEvoq9HwIql2p8OVs8d0ercTVASfeVKYOU8m8FR4UHDsbAAQKBgQDuHvRdWSJt1cBupRbwsnWd9nZ4cOmwkKSrzWmnRZtGBOja4x4IMO/4jLH71Rn+I3eRfg8bWEDLt39FjQ0WbfOZWQIlq7519ed9Q1oaa8Uzyo0WWoSnuipVbcNQ2UPTY50s9zRdwxlxzCQZe/fB/qpnrsqkYD3hxVgY7CWkgun84QKBgQC6o3DQpRhYXBbggIPnDftMVXSB8zZ34Ay7cMli5aAXMm3qghqocGXJMj27Mu/4ZS+ZE6mrbTASEHzTpzH1j7qh06IKtv2GXDYaljLl9Hdxsz7S+54fJbXB3yFpmGGmSTShxl8cakfU2I00k61a4Z80EnjiukLHbVLL88ANUaQcYQKBgHpGMOtCWxiVe5QVeBsvOJBdv+YG7Sk6jSSffVJkvuAMo1nK6GACaSdzb+3GNuu2YK64UZ+UCOnTFyqqzH6pBT7IYv7fGxVNqYo8LKeGkaQPrbU91AKg6R4nF/WLK3YAH/S4GA7RoV47GopviwD1+aD2M56GwSAPCzb5BDde9jJhAoGASVZfxhyZbF8DPkRBkFEWJfCOT2HaTVBksGKpP4srVPIj7rog7377AAwV5bEmSly4T1ZCnXHSKccAxco0/2Dy3RPj4IH3LQye1eOfLGzbYnokfZMRlvuiaAPdhTizZjvtyoPAa9H3V9Of6MD+pW9yt2tqxOybwPFcT3gARzuFWQECgYEAuAlOiTnJw5YOeT6ekNLFFlSbvBe/oTFaeKqbF2KdM3WMvvrOqfVYs+D5cBu+efEKdwhgIEF9FmlngqK/M2m7MALxI2Bz9BnNRuT1qi1ZVp8MMZPm2ZaS2xUlAp4JNQlDyvGZP8YBa2MvzdY+JdhhqHANQKNNl5YyIuKVhIsB2Zk=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn4YH9Ie6Jy4VhLBxzZPpfEg2NPMcLEfsbtJGA9shKc+Z9N08lISAqv6XOaKnv7adcOcKlXq+ZOWqllkAuA0lsL4AcluPzfblp1shpP1UY5Jyy0IQ/c0f6ov8PEuGNPC39RvTCdbPir1yGgbm3tSFLLfLXIxm1Usyo8T8YQK2ITiOl0fUL9E/7ecZM/GEtRG5vIe8jPOGpO4gQ/BW3Z2mngQUpdip4pALPIGUD01HnAbk/k2gAQUlsoE8xpPrWmxooYmMYJuOIEPc8Y68QNU/Rb7r5/8SCoPzWiKtcKQ+MEYYt1kdYXODbEM1Tmsx2OkHEUiu5vl/waFrxv8Fc/GCnQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8081/Neugh/tijiao";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8081/Neugh/tijiao";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

